Skip to content

ci: deploy via the Cloudflare Pages GitHub App#80

Closed
alukach wants to merge 6 commits into
mainfrom
ci/deploy-dispatch
Closed

ci: deploy via the Cloudflare Pages GitHub App#80
alukach wants to merge 6 commits into
mainfrom
ci/deploy-dispatch

Conversation

@alukach

@alukach alukach commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

Deployment moves to Cloudflare Pages via the Cloudflare GitHub App (git integration). Cloudflare builds and deploys on every push — this PR deletes the Actions deploy workflow entirely (the first two commits on this branch tried Actions-based approaches; the final commit supersedes them).

Trigger URL
Any PR / branch <branch>.stac-manager.pages.dev (isolated preview, URL posted on the PR by the App)
Push to main main.stac-manager.pages.dev (staging)
Push to release stac-manager.pages.dev (production)

Promotion to production = fast-forwarding the release branch (already created at the stac-manager-0.0.14 release commit): git push origin origin/main:release.

What's in this PR

  • packages/client/_redirects — SPA fallback (/* /index.html 200) the build command copies into dist/ so deep links resolve.
  • docs/DEPLOYMENT.md — environments, promotion flow, and the full Pages project configuration (build command, output dir, env vars, OIDC wildcard-redirect caveat).
  • No workflow: no CLOUDFLARE_* secrets in the repo; env vars live in the Pages project settings.

One-time setup (dashboard, needs org admin for the App install)

  1. Cloudflare dashboard (Development Seed account) → Workers & Pages → Create → Pages → Connect to Git → install the Cloudflare GitHub App on developmentseed with access to this repo.
  2. Project stac-manager, production branch release, build command npm run all:build && cp packages/client/_redirects packages/client/dist/, output directory packages/client/dist.
  3. Env vars (production + preview): REACT_APP_STAC_API, and PUBLIC_URL=/ (the build script requires it; / is correct everywhere since each deployment serves from its own subdomain root); optionally REACT_APP_STAC_BROWSER, OIDC vars.

Relationship to the existing GitHub Pages deploy

deploy-gh.yml keeps deploying main to GitHub Pages at https://stac-manager.ds.io/ — it is untouched by this PR and remains the production deployment of record. Cloudflare runs in parallel (previews + staging immediately; release deploys are a shadow production) until we decide to cut the stac-manager.ds.io DNS over to Cloudflare, at which point deploy-gh.yml gets removed in a follow-up.

🤖 Generated with Claude Code

Adds a workflow that turns every deployable ref into a GitHub Deployment
carrying a digest-pinned image reference:

- pull request branches -> transient per-PR preview-pr-<number> environment
  (deactivated automatically when the PR closes)
- pushes to main        -> staging
- published releases    -> production
- workflow_dispatch     -> manual staging/production dispatch

Each run builds and pushes the Docker image for the exact deployed commit
to ghcr (sha-pinned, plus pr-N / staging / semver convenience tags), then
creates the Deployment with the image in its payload and seeds a `queued`
status. The actual rollout is intentionally left to whatever subscribes to
deployment events (webhook listener, Argo CD, or a follow-up workflow),
which owns the in_progress -> success/failure status transitions.

Actions are pinned to commit SHAs per the repo convention (#67).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the deployment-dispatch workflow with a direct Cloudflare Pages
deploy: PR branches get isolated pr-<n> previews, pushes to main serve as
staging via the main branch alias, and published releases promote to the
project's production branch (release). Builds run in CI and upload via
wrangler so the monorepo build and repo-variable env config stay identical
to deploy-gh.yml. Each PR gets a single self-updating preview-URL comment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@alukach alukach changed the title ci: dispatch deployments for PR previews, staging (main), and production (releases) ci: deploy previews, staging, and production to Cloudflare Pages Jun 10, 2026
Drop the Actions deploy workflow in favor of Cloudflare's git integration:
the GitHub App builds and deploys every push, giving per-branch previews,
a main staging alias, and a release production branch with no repo secrets.
Add the SPA _redirects file the build command copies into dist, and
document the project configuration in docs/DEPLOYMENT.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@alukach alukach changed the title ci: deploy previews, staging, and production to Cloudflare Pages ci: deploy via the Cloudflare Pages GitHub App Jun 10, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

This comment was marked as outdated.

…late

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 11, 2026

Copy link
Copy Markdown

Deploying stac-manager with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4aff785
Status: ✅  Deploy successful!
Preview URL: https://9b44f647.stac-manager.pages.dev
Branch Preview URL: https://ci-deploy-dispatch.stac-manager.pages.dev

View logs

PUBLIC_URL=/ produced protocol-relative //meta/... URLs for the header
icon, favicons, and og:image, which browsers resolve against a host
named "meta". Joining was only correct for absolute bases without a
trailing slash.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@alukach alukach closed this Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant